<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page import="java.io.*"%>
<%@ page import="java.util.*" %>
<%@ page import="java.math.*" %>
<%@ page import="top.dreamyy.pattern.util.common.AccessCount" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Welcome To Website</title>
<link rel="stylesheet" href="css/style.css"  type="text/css" />
<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Tangerine"> 
</head>
<body>
	<%
		BigInteger count  = null;
		AccessCount ac = new AccessCount();
		String fileName =this.getServletContext().getRealPath("/")+"counter.txt";  
		File file = new File(fileName);
		//去掉session.isnew()为每刷新一次页面就增1
		if(session.isNew()){
			//同步操作
			synchronized(this){
				count = ac.load(file);
				//对count进行自增一的操作
				count = count.add(new BigInteger("1"));
				ac.save(file, count);
			}
		}
	%>
<div class="bo">
	<div class="header">
		Design      Pattern
	</div>
	<div class="container">
		<a href="login" class="service-item mar_l" > 
			<span class="service-icon-wrap">
				<img src="images/a1.png" alt="service icon" class="service-icon" style="width: 90px;height: 90px">
			</span>
			<h3 class="service-title">登陆</h3>
		</a> 
		<a href="Register" class="service-item"> 
			<span class="service-icon-wrap">
				<img src="images/a2.png" alt="service icon" class="service-icon"style="width: 90px;height: 90px">
			</span>
			<h3 class="service-title">注册</h3>
		</a> 
		<a href="suggest" class="service-item"> 
			<span class="service-icon-wrap">
				<img src="images/a3.png" alt="service icon" class="service-icon"style="width: 90px;height: 90px">
			</span>
			<h3 class="service-title">提出建议</h3>
		</a>
		<label class="lab">第<%=count==null?1:count %>位访问本网站！</label>
	</div>
</div>
<script src='js/jquery.js'></script>
</body>
</html>